package com.macro.mall.tiny.config;

import com.aliyun.oss.OSSClient;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Created by macro on 2018/5/17.
 */
@Configuration
public class OssConfig {
    @Value("${aliyun.oss.endpoint}")
    private String ALIYUN_OSS_ENDPOINT;
    @Value("${aliyun.oss.accessKeyId}")
    private String ALIYUN_OSS_ACCESSKEYID;
    @Value("${aliyun.oss.accessKeySecret}")
    private String ALIYUN_OSS_ACCESSKEYSECRET;
    @Bean
    public OSSClient ossClient(){
        return new OSSClient(ALIYUN_OSS_ENDPOINT,ALIYUN_OSS_ACCESSKEYID,ALIYUN_OSS_ACCESSKEYSECRET);
    }

    public String getALIYUN_OSS_ENDPOINT() {
        return ALIYUN_OSS_ENDPOINT;
    }

    public void setALIYUN_OSS_ENDPOINT(String ALIYUN_OSS_ENDPOINT) {
        this.ALIYUN_OSS_ENDPOINT = ALIYUN_OSS_ENDPOINT;
    }

    public String getALIYUN_OSS_ACCESSKEYID() {
        return ALIYUN_OSS_ACCESSKEYID;
    }

    public void setALIYUN_OSS_ACCESSKEYID(String ALIYUN_OSS_ACCESSKEYID) {
        this.ALIYUN_OSS_ACCESSKEYID = ALIYUN_OSS_ACCESSKEYID;
    }

    public String getALIYUN_OSS_ACCESSKEYSECRET() {
        return ALIYUN_OSS_ACCESSKEYSECRET;
    }

    public void setALIYUN_OSS_ACCESSKEYSECRET(String ALIYUN_OSS_ACCESSKEYSECRET) {
        this.ALIYUN_OSS_ACCESSKEYSECRET = ALIYUN_OSS_ACCESSKEYSECRET;
    }
}
